\(\int \cos ^2(a+b x) \sin ^2(a+b x) \, dx\) [60]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 17, antiderivative size = 46 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\frac {x}{8}+\frac {\cos (a+b x) \sin (a+b x)}{8 b}-\frac {\cos ^3(a+b x) \sin (a+b x)}{4 b} \]

[Out]

1/8*x+1/8*cos(b*x+a)*sin(b*x+a)/b-1/4*cos(b*x+a)^3*sin(b*x+a)/b

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.176, Rules used = {2648, 2715, 8} \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=-\frac {\sin (a+b x) \cos ^3(a+b x)}{4 b}+\frac {\sin (a+b x) \cos (a+b x)}{8 b}+\frac {x}{8} \]

[In]

Int[Cos[a + b*x]^2*Sin[a + b*x]^2,x]

[Out]

x/8 + (Cos[a + b*x]*Sin[a + b*x])/(8*b) - (Cos[a + b*x]^3*Sin[a + b*x])/(4*b)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2648

Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Simp[(-a)*(b*Cos[e
 + f*x])^(n + 1)*((a*Sin[e + f*x])^(m - 1)/(b*f*(m + n))), x] + Dist[a^2*((m - 1)/(m + n)), Int[(b*Cos[e + f*x
])^n*(a*Sin[e + f*x])^(m - 2), x], x] /; FreeQ[{a, b, e, f, n}, x] && GtQ[m, 1] && NeQ[m + n, 0] && IntegersQ[
2*m, 2*n]

Rule 2715

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(-b)*Cos[c + d*x]*((b*Sin[c + d*x])^(n - 1)/(d*n))
, x] + Dist[b^2*((n - 1)/n), Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integ
erQ[2*n]

Rubi steps \begin{align*} \text {integral}& = -\frac {\cos ^3(a+b x) \sin (a+b x)}{4 b}+\frac {1}{4} \int \cos ^2(a+b x) \, dx \\ & = \frac {\cos (a+b x) \sin (a+b x)}{8 b}-\frac {\cos ^3(a+b x) \sin (a+b x)}{4 b}+\frac {\int 1 \, dx}{8} \\ & = \frac {x}{8}+\frac {\cos (a+b x) \sin (a+b x)}{8 b}-\frac {\cos ^3(a+b x) \sin (a+b x)}{4 b} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.05 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.50 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=-\frac {-4 (a+b x)+\sin (4 (a+b x))}{32 b} \]

[In]

Integrate[Cos[a + b*x]^2*Sin[a + b*x]^2,x]

[Out]

-1/32*(-4*(a + b*x) + Sin[4*(a + b*x)])/b

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.41

method result size
risch \(\frac {x}{8}-\frac {\sin \left (4 b x +4 a \right )}{32 b}\) \(19\)
parallelrisch \(\frac {4 b x -\sin \left (4 b x +4 a \right )}{32 b}\) \(22\)
derivativedivides \(\frac {-\frac {\left (\cos ^{3}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{4}+\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{8}+\frac {b x}{8}+\frac {a}{8}}{b}\) \(43\)
default \(\frac {-\frac {\left (\cos ^{3}\left (b x +a \right )\right ) \sin \left (b x +a \right )}{4}+\frac {\cos \left (b x +a \right ) \sin \left (b x +a \right )}{8}+\frac {b x}{8}+\frac {a}{8}}{b}\) \(43\)
norman \(\frac {\frac {x}{8}-\frac {\tan \left (\frac {b x}{2}+\frac {a}{2}\right )}{4 b}+\frac {7 \left (\tan ^{3}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{4 b}-\frac {7 \left (\tan ^{5}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{4 b}+\frac {\tan ^{7}\left (\frac {b x}{2}+\frac {a}{2}\right )}{4 b}+\frac {x \left (\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2}+\frac {3 x \left (\tan ^{4}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{4}+\frac {x \left (\tan ^{6}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{2}+\frac {x \left (\tan ^{8}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )}{8}}{\left (1+\tan ^{2}\left (\frac {b x}{2}+\frac {a}{2}\right )\right )^{4}}\) \(139\)

[In]

int(cos(b*x+a)^2*sin(b*x+a)^2,x,method=_RETURNVERBOSE)

[Out]

1/8*x-1/32/b*sin(4*b*x+4*a)

Fricas [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 36, normalized size of antiderivative = 0.78 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\frac {b x - {\left (2 \, \cos \left (b x + a\right )^{3} - \cos \left (b x + a\right )\right )} \sin \left (b x + a\right )}{8 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(b*x+a)^2,x, algorithm="fricas")

[Out]

1/8*(b*x - (2*cos(b*x + a)^3 - cos(b*x + a))*sin(b*x + a))/b

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 92 vs. \(2 (37) = 74\).

Time = 0.16 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.00 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\begin {cases} \frac {x \sin ^{4}{\left (a + b x \right )}}{8} + \frac {x \sin ^{2}{\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{4} + \frac {x \cos ^{4}{\left (a + b x \right )}}{8} + \frac {\sin ^{3}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{8 b} - \frac {\sin {\left (a + b x \right )} \cos ^{3}{\left (a + b x \right )}}{8 b} & \text {for}\: b \neq 0 \\x \sin ^{2}{\left (a \right )} \cos ^{2}{\left (a \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(cos(b*x+a)**2*sin(b*x+a)**2,x)

[Out]

Piecewise((x*sin(a + b*x)**4/8 + x*sin(a + b*x)**2*cos(a + b*x)**2/4 + x*cos(a + b*x)**4/8 + sin(a + b*x)**3*c
os(a + b*x)/(8*b) - sin(a + b*x)*cos(a + b*x)**3/(8*b), Ne(b, 0)), (x*sin(a)**2*cos(a)**2, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.52 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\frac {4 \, b x + 4 \, a - \sin \left (4 \, b x + 4 \, a\right )}{32 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(b*x+a)^2,x, algorithm="maxima")

[Out]

1/32*(4*b*x + 4*a - sin(4*b*x + 4*a))/b

Giac [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.39 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\frac {1}{8} \, x - \frac {\sin \left (4 \, b x + 4 \, a\right )}{32 \, b} \]

[In]

integrate(cos(b*x+a)^2*sin(b*x+a)^2,x, algorithm="giac")

[Out]

1/8*x - 1/32*sin(4*b*x + 4*a)/b

Mupad [B] (verification not implemented)

Time = 0.12 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.09 \[ \int \cos ^2(a+b x) \sin ^2(a+b x) \, dx=\frac {x}{8}-\frac {\frac {\mathrm {tan}\left (a+b\,x\right )}{8}-\frac {{\mathrm {tan}\left (a+b\,x\right )}^3}{8}}{b\,\left ({\mathrm {tan}\left (a+b\,x\right )}^4+2\,{\mathrm {tan}\left (a+b\,x\right )}^2+1\right )} \]

[In]

int(cos(a + b*x)^2*sin(a + b*x)^2,x)

[Out]

x/8 - (tan(a + b*x)/8 - tan(a + b*x)^3/8)/(b*(2*tan(a + b*x)^2 + tan(a + b*x)^4 + 1))